<?php
    require('db_connection.php');
    $day = date("d");
    $month = date ("m");
    $year = date("Y");
   // $hour = time("");
   
    
    $reserveday = mktime(0,0,0,$day,$month,$year);
    $expireday = mktime(0,0,0,$day+1,$month,$year);
    $result = $reserveday - $expireday;
    echo $result;
    echo "<br>";
   // $reserveday = mktime(1,30,12,$year,$month,$day);
    $reservedate = date("Y-m-d", mktime(0,0,0,$month,$day,$year));
    $expiredate = date("Y-m-d", mktime(0,0,0,$month,$day +1,$year));

    //$nextday = mktime(0,0,0,"Y","m","d" + 1);
    echo $day;
    echo $month;
    echo $year;
    echo "<br>";
   echo $reservedate;
    echo "<br>";
   echo $expiredate;
    echo "<br>";

    
   
  //$one = $expiredate. " ".date("h:i:s",time());
  $one = date("Y-m-d H:i.s",time());
  $two = date("Y-m-d H:i.s",time()+86400);
  
$query = "INSERT INTO tbldate VALUES('$one', '$two','5')";
  $result = mysql_query($query);

   echo $one;
  // echo $now;

$query2 = "SELECT * FROM tbldate WHERE num='2' ";
$result2 = mysql_query($query2);

while($row = mysql_fetch_array($result2))
{
  $date1 = $row['reserve'];
  $date2 = $row['expire'];

}
$today = date("Y-m-d H:i.s",time());
if($today<$date2)
{
  
  echo "hh";
}
else
    echo "expired";
mysql_close();
?>
